home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
conhlp.arc
/
HEADER.ASM
< prev
next >
Wrap
Assembly Source File
|
1988-11-11
|
7KB
|
271 lines
; HEADER.ASM
name ConsoleHelpPreludeModule
DGROUP GROUP _DATA
PGROUP GROUP _TEXT
assume cs:PGROUP, ds:DGROUP
_TEXT segment public 'CODE'
;VAP definitions
public NetWareShellServices, ProcessControlServices
public ConsoleControlServices, IPXSPXServices
;external routines
extrn _ConsoleHandler: near, _DownHandler: near, _Main: near
;VAP Header
Signature db 'NWProc'
NetWareShellServices dd ?
ProcessControlServices dd ?
ConsoleControlServices dd ?
IPXSPXServices dd ?
VAPConsoleHandler dd ConsoleHandlerCALL
VAPDownHandler dd DownHandlerCALL
VAPConsoleOrDownDataSegment dw DGroup
VAPConnectionRequestFlag dw 0 ; Connection Needed
VAPNameString db 'Console Help VAP.', 64-($-VAPNameString) dup(0)
VAPConsoleKeyWordCount dw 18
VAPKeyword0 db '? P', 16-($-VAPKeyword0) dup(0)
VAPKeyword1 db '? PRINTER', 16-($-VAPKeyword1) dup(0)
VAPKeyword2 db '? Q', 16-($-VAPKeyword2) dup(0)
VAPKeyword3 db '? QUEUE', 16-($-VAPKeyword3) dup(0)
VAPKeyword4 db '? D', 16-($-VAPKeyword4) dup(0)
VAPKeyword5 db '? DISK', 16-($-VAPKeyword5) dup(0)
VAPKeyword6 db '? S', 16-($-VAPKeyword6) dup(0)
VAPKeyword7 db '? SERVER', 16-($-VAPKeyword7) dup(0)
VAPKeyword8 db '? M', 16-($-VAPKeyword8) dup(0)
VAPKeyword9 db '? MESSAGE', 16-($-VAPKeyword9) dup(0)
VAPKeyword10 db '? C', 16-($-VAPKeyword10) dup(0)
VAPKeyword11 db '? CONNECTION', 16-($-VAPKeyword11) dup(0)
VAPKeyword12 db '? V', 16-($-VAPKeyword12) dup(0)
VAPKeyword13 db '? VAP', 16-($-VAPKeyword13) dup(0)
VAPKeyword14 db '? O', 16-($-VAPKeyword14) dup(0)
VAPKeyword15 db '? OTHER', 16-($-VAPKeyword15) dup(0)
VAPKeyword16 db '?', 16-($-VAPKeyword16) dup(0)
VAPKeyword17 db 'HELP', 16-($-VAPKeyword17) dup(0)
VAPSignOnMessage db 10,13,'╔═══════════════════════════════════════════════════════╗',13,10
db '║ File Server Console HELP ║',13,10
db '║ -An online help utility for console commands ║',13,10
db '╚═══════════════════════════════════════════════════════╝',13,10,0
db 500-($-VAPSignOnMessage) dup(0)
VAPStart proc near
mov ax, DGroup
mov di, 1 ;change segment to data (read/write)
call dword ptr cs:ProcessControlServices
cli
mov ax, DGroup
mov ds, ax
mov es, ax
mov ss, ax
mov ax, OFFSET DGroup:MainStackEnd
mov sp, ax
sti
mov ax, PGroup
mov _MyHeaderSegment, ax
call _Main
VAPStart endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Handler front-ends
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ConsoleHandlerCALL proc far
mov _Keyword, ax
call _ConsoleHandler
ret
ConsoleHandlerCALL endp
DownHandlerCALL proc far
call _DownHandler
ret
DownHandlerCALL endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Misc Procedures
;; MSC stack check fake-out
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
public __CHKSTK
public _VGetCurrentDisk
public _VOpen
public _VClose
public _VRead
public _VGetFileServerName
public _VInString
public _VSeek
;Parameters and Usage:
; ccode = VOpen( filename, mode, &handle );
_VOpen proc near
push bp
mov bp, sp
push ds
mov si, [bp + 6] ;put mode into AL
mov ax, si
mov ah, 3dh
mov dx, [bp + 4]
call dword ptr cs: NetWareShellServices
jc OpenFailure
OpenSuccess:
mov si, [bp + 8]
mov [si], ax
xor ax, ax
jmp OpenDone
OpenFailure:
mov si, [bp + 8]
mov word ptr [si], -1
OpenDone:
pop ds
pop bp
ret
_VOpen endp
;
;Parameters and Usage:
; ccode = VClose( handle );
_VClose proc near
push bp
mov bp, sp
mov al, [bp+4]
mov ah, 3Eh
call dword ptr cs: NetWareShellServices
pop bp
ret
_VClose endp
;
;Usage: bytesRead = VRead( int handle, char *buffer, int count );
;
_VRead proc near
push bp
mov bp, sp
mov bx, [bp+4] ;Handle
mov dx, [bp+6] ;Buffer
mov cx, [bp+8] ;Count
mov ah, 3Fh
call dword ptr cs: NetWareShellServices
jnc ReadDone ;Carry Set means error
mov ax, -1 ;Return a -1
ReadDone:
pop bp
ret
_VRead endp
__CHKSTK proc near
pop cx ; get return offset
sub sp,ax ; allocate stack space
jmp cx ; return to cx
__CHKSTK endp
_VGetCurrentDisk proc near
mov ax, 019FFh
call dword ptr cs:NetWareShellServices
ret
_VGetCurrentDisk endp
;
; Usage: ccode = VGetFileServerName( char * buffer);
; (ccode will contain 0 if on file server, 1 if on a bridge)
;
_VGetFileServerName proc near
push bp
mov bp, sp
push es
mov si, DGroup
mov es, si
mov si, [bp + 4]
mov di, 14h ;load the read function into AH
call dword ptr cs: ProcessControlServices
xor ah, ah
pop es
pop bp
ret
_VGetFileServerName endp
;
; USAGE: newPointer = VSeek( int handle, long offset, int loc );
; NOTE: newPointer is a long
; loc can be: 0 (beginning of file)
; 1 (current location in file)
; 2 (end of file)
;
_VSeek proc near
push bp
mov bp, sp
push ax
push bx
push cx
push dx
mov bx, [bp+4] ;Handle
mov dx, [bp+6] ;Offset (passed as a long)
mov cx, [bp+8] ;Offset (continued)
mov al, [bp+10] ;Seek relative to this location
mov ah, 42h
call dword ptr cs: NetWareShellServices
jnc SeekDone ;Carry means error
mov ax, -1 ;Return a -1
SeekDone:
pop dx
pop cx
pop bx
pop di
pop bp
ret
_VSeek endp
;
; Usage: actualLength = VInString( int row, int col, char *prompt,
; char *buffer, int buffLength );
;
_VInString proc near
push bp
mov bp, sp
push ds
pop es
mov ah, byte ptr [bp + 4] ;row coordinate
mov al, byte ptr [bp + 6] ;column coordinate
mov si, [bp + 8] ;pointer to prompt message
mov di, [bp + 10] ;pointer to input buffer
mov bx, di
mov dl, byte ptr [bp + 12] ;input buffer length
mov di, 11
call dword ptr cs: ConsoleControlServices
pop bp
ret
_VInString endp
_TEXT ends
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Data definitions
;; Define all stacks for all processes and also define keyword variable
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
_DATA SEGMENT word public 'DATA'
;set up new stack
dw 256 dup ('SS')
MainStackEnd label word
;Keyword that will be used in C program
public _Keyword
public _MyHeaderSegment
_Keyword dw 0
_MyHeaderSegment dw 0
_DATA ENDS
end VAPStart